home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
comm
/
prtcs155.zip
/
EMP.WPL
< prev
next >
Wrap
Text File
|
1994-01-14
|
5KB
|
195 lines
/**/
v="$VER: EMP Wplrx Empire Environment Process Williamson 51.02"
epath = "OS3:games/EMP2/Progs/"
gpath = "OS3:games/EMP2/Game/"
empfile.1= "FILE:ADSCOMM/EMPFE.LHA"
empdesc.1= ' 1 - Information text in Amiga Empire'
empfile.2= "FILE:ADSCOMM/EMPHELP.LHA"
empdesc.2= ' 2 - Empire Graphic Terminal Program'
empfile.3= "FILE:ADSCOMM/EMPDOCPP.LHA"
empdesc.3= ' 3 - PowerPacked Empire Player Documentation'
empfile.4= "INFO:EMPIRE.TEXT"
empdesc.4= ' 4 - Empire Online Help files'
empfiles = 4
trace background
options results
options failat 20
signal on syntax
signal on halt
signal on ioerr
signal on break_c
signal on break_d
if ~show("L", "rexxsupport.library") then
if ~addlib("rexxsupport.library", 0, -30, 0) then exit 20
log=show('P','ROOFLOG')
script = 'EmpireWPL'
rpath = addslash(dequote(GetClip('REXXDIR')))
mailer=GetCLip('SHELTER')
l_mailer=lower(mailer)
quote='"'
cr= '\r\n'
Pragma('D',gpath)
setstack="stack 30000"||'0a'x
parse arg baud line username
if username="" then username = 'Unknown User'
resp=prompt(60,cr||' 'username', Would you like to download Amiga Empire Players Files? y/N: ')
if upper(resp) = 'Y' then call req
resp=prompt(60,cr||' 'username', Do you wish to play empire now? Y/n: ')
if upper(resp) = 'N' then do
call send(cr||'Returning to Login:'||cr)
call cleanup
exit 0
end
if ~show('P','Empire port') then do
call send(cr||'Launching Empire server, please wait'||cr)
PutLog('Loading Empire Server',10,10)
com=setstack||'Run' gpath'EmpServ'
address COMMAND com
do i = 1 to 900
if ~showlist('p','Empire port') then do
call send('.')
call delay 10
end;else leave i
end
if ~showlist('p','Empire port') then do
call send(cr||'Sorry, system resources under heavy load, try again later'||cr)
PutLog('Empire port did not open fast enough',10,10)
exit
end
end
call send(cr||' Loading SerEMP'||cr)
call send(cr||' Type 'creationpassword' when creating a new country and then your')
call send(cr||' own private country password when asked.')
'String $(device) $(unit)'
x=RESULT;device=word(x,1);unit=word(x,2)
Call PutLog('Launching SerEmpire @ 'baud' bps on line' line 'device:'device' unit:'unit,10,10)
com=setstack||epath'SerEMP -Getty -DEVICE 'device' -UNIT 'unit
address COMMAND com
Empire_exitcode=RC
Call PutLog('SerEmp exited RC:'Empire_exitcode,10,10)
Call PutLog('Shutting down Empire',10,10)
call send(cr||'Exiting Empire Server'||cr)
com=setstack||epath"EmpSHUT"
address COMMAND com
Empire_exitcode=RC
Call PutLog('EmpShut exited RC:'Empire_exitcode,10,10)
exit 0
req:
call send(cr||' The following Amiga Empire files are available'||cr)
do i=1 to empfiles
call send(empdesc.i||cr)
end
call send(cr||' Enter the number(s) of the file(s) you want, separated by a space or hit CR to abort'||cr||cr)
resp=prompt(240,' Select: ')
if words(resp) ~= 0 then do
do i=1 to words(resp)
select=word(resp,i)
if datatype(select,'N') then do
if exists(empfile.select) then call xfer(empfile.select,get_fn(empfile.select))
else call send(cr||'Can not find 'empfile.select)
end
else call send(cr||'Invalid selection:'select)
end
end
return 0
send:
'Print' quote||arg(1)||quote
'Send' quote||arg(1)||quote
return
prompt:
call send(cr||arg(2))
getstring:
'GetInbound E0 'arg(1)
'String $(event)'
if upper(RESULT) = 'CARRIER' then do
'RexxMsg NY "LOGPROC" "PutLog 'l_mailer'wpl $<time> $(line) Lost Carrier"'
call PutLog('Lost carrier',10,10)
call cleanup
exit
end
if upper(RESULT) = 'LOGIN' then do
'String $(namebuf)'
x= upper(RESULT)
end
else x=""
return x
xfer:
fulname=arg(1)
filname=arg(2)
'Set protocol ZMODEM'
'XprSetup xprzedzap.library "TN,ON,B8,F0,E30,AN,DN,KN,SY,RN,M1024"'
'SetUpDate "CON:0/60/640/$($(line).w_offset)/$(protocol) Empire Server/AUTO/SCREEN$(pscreen)"'
'XprSend' fulname
'XprClose'
'SetUpDate NULL'
return 0
get_fn:
if LastPos('/', arg(1)) ~= 0 then return SubStr(arg(1), LastPos('/', arg(1)) + 1)
else if LastPos(':', arg(1)) ~= 0 then return SubStr(arg(1), LastPos(':', arg(1)) + 1)
else return arg(1)
PutLog: procedure expose log script
if arg(3) < GetClip('STATUSLEVEL') then say arg(1)
if arg(2) > GetClip('LOGLEVEL') then return 0
if log then address 'ROOFLOG' 'logline' left(time(),5) script': 'arg(1)
return 0
addslash:
curr = arg(1)
select
when right(curr, 1) = ":" then nop
when right(curr, 1) = "/" then nop
otherwise curr = curr"/"
end
return curr
dequote:
parse arg thing
parse var thing '"' unq_thing '"'
if unq_thing ~= "" then return unq_thing
return thing
cleanup:
return
break_c:
break_d:
PutLog('User abort',10,10)
call cleanup
exit 10
novalue:
call template_oops "Novalue" sigl
syntax:
call template_oops "Syntax(RC=" || RC || ")" sigl
failure:
call template_oops "Failure(RC=" || RC || ")" sigl
ioerr:
call template_oops "IOErr" sigl
halt:
call template_oops "Halt" sigl
template_oops:
parse arg what badline
PutLog('ERR:'what "Line:"badline,10,10)
PutLog('ERR:'strip(sourceline(badline)),10,10)
call cleanup
exit(40)
/**/